home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / xml / ElementDeclaration.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  19.1 KB  |  759 lines

  1. package com.extensibility.xml;
  2.  
  3. import com.extensibility.util.Debug;
  4. import com.extensibility.util.FilteredEnumerator;
  5. import com.extensibility.util.RHashtable;
  6. import com.extensibility.util.XASet;
  7. import com.extensibility.xml.dt.DataType;
  8. import com.extensibility.xml.dt.DataTypeFactory;
  9. import com.extensibility.xml.dt.DataTypeIntf;
  10. import java.io.IOException;
  11. import java.io.Writer;
  12. import java.util.Enumeration;
  13. import java.util.Hashtable;
  14. import java.util.MissingResourceException;
  15. import java.util.Vector;
  16. import javax.swing.event.ChangeListener;
  17.  
  18. public class ElementDeclaration extends BaseDeclaration implements Cloneable, AttributeDeclaration.Owner, ContentModelOwner, CMTReferent, DeclRef.SourceIntf {
  19.    public static final int TYPE_MIXED = 4;
  20.    public static final int TYPE_TAGS_ONLY = 6;
  21.    public static final int TYPE_TEXT_ONLY = 5;
  22.    public static final int TYPE_ANY = 2;
  23.    public static final int TYPE_EMPTY = 3;
  24.    // $FF: renamed from: cm com.extensibility.xml.ContentModel
  25.    ContentModel field_0;
  26.    AttributeGroup attributes;
  27.    Vector modelsUsed;
  28.    RHashtable refMetaProp;
  29.    DeclRef superType;
  30.    DataType dataType;
  31.    ChangeListener changer;
  32.  
  33.    public ElementDeclaration(String var1) {
  34.       this(var1, 3);
  35.    }
  36.  
  37.    public ElementDeclaration(String var1, int var2) {
  38.       super(var1);
  39.       this.attributes = new AttributeGroup(this);
  40.       this.modelsUsed = new Vector();
  41.       this.refMetaProp = new RHashtable();
  42.       this.changer = new 6(this);
  43.       this.field_0 = new ContentModel(this, var2);
  44.    }
  45.  
  46.    public ElementDeclaration(String var1, DataType var2) {
  47.       this(var1);
  48.       this.setDataType(var2);
  49.    }
  50.  
  51.    public BaseDeclaration clone(SchemaIntf var1, SchemaIntf var2, URI var3) {
  52.       ElementDeclaration var4 = null;
  53.  
  54.       try {
  55.          var4 = (ElementDeclaration)super.clone();
  56.          ((BaseDeclaration)var4).setURI(var3);
  57.          var4.attributes = (AttributeGroup)var4.attributes.clone(var4, var1, var2);
  58.          var4.field_0 = (ContentModel)var4.field_0.clone(var4, var1, var2);
  59.          var4.refMetaProp = this.refMetaProp.clone(true);
  60.          if (this.superType != null) {
  61.             var4.superType = new DeclRef(this.superType.getName(), this.superType.getTargetClass());
  62.          }
  63.       } catch (CloneNotSupportedException var6) {
  64.          Debug.assert(false, "Problem cloning ElementDeclaration.");
  65.       }
  66.  
  67.       return var4;
  68.    }
  69.  
  70.    public Object clone() {
  71.       ElementDeclaration var1 = null;
  72.  
  73.       try {
  74.          var1 = (ElementDeclaration)super.clone();
  75.          var1.attributes = new AttributeGroup(var1, this.attributes.getMembers());
  76.          var1.field_0 = (ContentModel)var1.field_0.clone(var1);
  77.          if (this.superType != null) {
  78.             var1.superType = new DeclRef(this.superType.getName(), this.superType.getTargetClass());
  79.          }
  80.       } catch (CloneNotSupportedException var3) {
  81.          Debug.assert(false, "Problem cloning ElementDeclaration.");
  82.       }
  83.  
  84.       return var1;
  85.    }
  86.  
  87.    public String getClassName() {
  88.       return "com.extensibility.xml.ElementDeclaration";
  89.    }
  90.  
  91.    public Vector getAttributeMembers() {
  92.       return this.getAttributesCopy();
  93.    }
  94.  
  95.    public void modelStateChanged(ContentModelTerm var1, int var2, Object var3) {
  96.       if (var2 == 20) {
  97.          this.updateRefMetaProp(var3.toString(), var1.getTerm());
  98.       }
  99.  
  100.       ((BaseDeclaration)this).fireChangeEvent(31, var3);
  101.    }
  102.  
  103.    public void useNotify(ContentModelOwner var1) {
  104.       this.modelsUsed.addElement(var1);
  105.    }
  106.  
  107.    public void usedByNotify(ContentModelOwner var1) {
  108.       Debug.assert(false, "models owned by elements can't be used by others");
  109.    }
  110.  
  111.    public void unuseNotify(ContentModelOwner var1) {
  112.       Debug.trace(String.valueOf(String.valueOf(((BaseDeclaration)this).getName()).concat(String.valueOf(" got a unuseNotify for "))).concat(String.valueOf(var1.getName())));
  113.       if (!this.modelsUsed.removeElement(var1)) {
  114.          Debug.assert(false, "removing a model that didn't exist");
  115.       }
  116.  
  117.    }
  118.  
  119.    public void unusedByNotify(ContentModelOwner var1) {
  120.       Debug.trace(String.valueOf(String.valueOf(((BaseDeclaration)this).getName()).concat(String.valueOf(" got a unusedByNotify for "))).concat(String.valueOf(var1.getName())));
  121.       Debug.assert(false, "models owned by elements can't be used by others");
  122.    }
  123.  
  124.    public void visitTerms(ContentModelTerm.Visitor var1, boolean var2) {
  125.       if (var2) {
  126.          this.getEffectiveModel().visitTerms(var1, var2);
  127.       } else {
  128.          this.field_0.visitTerms(var1, var2);
  129.       }
  130.  
  131.    }
  132.  
  133.    public ContentModelTermEnum getTerms(boolean var1) {
  134.       return var1 ? this.getEffectiveModel().getTerms(var1) : this.field_0.getTerms(var1);
  135.    }
  136.  
  137.    public ContentModelTermEnum getLeafTerms() {
  138.       return this.getEffectiveModel().getLeafTerms();
  139.    }
  140.  
  141.    public boolean isSubordinate(BaseDeclaration var1) {
  142.       return var1 instanceof AttributeDeclaration && ((AttributeDeclaration)var1).getOwner() == this;
  143.    }
  144.  
  145.    public boolean getCMOpen() {
  146.       return this.field_0.isOpen();
  147.    }
  148.  
  149.    public boolean getCMisAny() {
  150.       return this.field_0.isAny();
  151.    }
  152.  
  153.    public boolean getCMisMixed() {
  154.       return this.field_0.isMixed();
  155.    }
  156.  
  157.    public boolean getAllowsData() {
  158.       return this.dataType != null;
  159.    }
  160.  
  161.    public boolean isTextOnly() {
  162.       return this.field_0.isTextOnly();
  163.    }
  164.  
  165.    public boolean getAllowsTags() {
  166.       if (this.getSuperType() != null) {
  167.          return !this.field_0.isEmpty() || this.getSuperType().getTargetElement() != null && this.getSuperType().getTargetElement().getAllowsTags();
  168.       } else {
  169.          return !this.getAllowsData() && this.field_0.getAllowsTags();
  170.       }
  171.    }
  172.  
  173.    public boolean getAllowsText() {
  174.       if (this.getSuperType() == null) {
  175.          return this.field_0.getAllowsText();
  176.       } else {
  177.          return this.getSuperType().getTargetElement() != null && this.getSuperType().getTargetElement().getAllowsText();
  178.       }
  179.    }
  180.  
  181.    public ContentModel getContentModel() {
  182.       return this.field_0;
  183.    }
  184.  
  185.    public String getDefault() {
  186.       return null;
  187.    }
  188.  
  189.    public DataType getDataType() {
  190.       return this.dataType;
  191.    }
  192.  
  193.    public String getDataTypeDisplay(SchemaIntf var1) {
  194.       if (this.getDataType() == null) {
  195.          return "";
  196.       } else if (this.getDataType().equals(DataTypeFactory.createDataType(DataTypeIntf.NOTATED))) {
  197.          AttributeDeclaration var2 = this.getNotationAttr();
  198.          return var2 == null ? "" : var2.getDefault();
  199.       } else {
  200.          return var1.getDataTypeDisplay(this.getDataType());
  201.       }
  202.    }
  203.  
  204.    public boolean references(InternalPEDeclaration var1) {
  205.       if (var1.getAttributeGroup() != null) {
  206.          return this.attributes.contains(var1.getAttributeGroup());
  207.       } else if (var1.getContentModel() != null) {
  208.          return this.modelsUsed.indexOf(var1) >= 0;
  209.       } else {
  210.          return false;
  211.       }
  212.    }
  213.  
  214.    public String getFirstMissingPrefix(SchemaIntf var1) {
  215.       Vector var2 = new Vector();
  216.       this.visitTerms(new 1(var1, var2, (ElementDeclaration)null), true);
  217.       return var2.size() == 0 ? null : (String)var2.firstElement();
  218.    }
  219.  
  220.    public String getFirstMissingTerm(SchemaIntf var1, boolean var2) {
  221.       Vector var3 = new Vector();
  222.       this.visitTerms(new 2(var2, var3, (ElementDeclaration)null), true);
  223.       return var3.size() == 0 ? null : (String)var3.firstElement();
  224.    }
  225.  
  226.    public Vector getPrerequisites(SchemaIntf var1) {
  227.       Vector var2 = super.getPrerequisites(var1);
  228.       this.attributes.getUsesList(var2);
  229.       BaseDeclaration var3 = var1.getDeclarationAfter(this);
  230.       if (var3 != null && var3 instanceof EntityDeclaration && var2 != null && var2.contains(var3)) {
  231.          var2.removeElement(var3);
  232.       }
  233.  
  234.       this.field_0.getUsesList(var2);
  235.       if (this.getSuperType() != null && this.getSuperType().getTargetDecl() != null) {
  236.          var2.addElement(this.getSuperType().getTargetDecl());
  237.       }
  238.  
  239.       return var2;
  240.    }
  241.  
  242.    public void checkForErrors(SchemaIntf var1) {
  243.       super.checkForErrors(var1);
  244.       boolean var2 = var1.isSupported(Class.forName("com.extensibility.xml.NamespaceDeclaration"));
  245.       String var4 = this.getFirstMissingTerm(var1, var2);
  246.       if (var4 != null) {
  247.          super.errors.addElement(new ParserException(210, var4));
  248.       }
  249.  
  250.       if (var2) {
  251.          String var5 = this.getFirstMissingPrefix(var1);
  252.          if (var5 != null) {
  253.             super.errors.addElement(new ParserException(238, var5));
  254.          }
  255.       }
  256.  
  257.       boolean var12 = false;
  258.       boolean var6 = false;
  259.       Hashtable var7 = new Hashtable();
  260.       Enumeration var8 = this.getAttributes(true);
  261.  
  262.       while(var8.hasMoreElements()) {
  263.          AttributeDeclaration var9 = (AttributeDeclaration)var8.nextElement();
  264.          if (var7.containsKey(((BaseDeclaration)var9).getName())) {
  265.             super.errors.addElement(new ParserException(212, ((BaseDeclaration)var9).getName()));
  266.          } else {
  267.             var7.put(((BaseDeclaration)var9).getName(), var9);
  268.          }
  269.  
  270.          if (var9.isID()) {
  271.             if (var12) {
  272.                super.errors.addElement(new ParserException(211, ((BaseDeclaration)var9).getName()));
  273.             } else {
  274.                var12 = true;
  275.             }
  276.          }
  277.  
  278.          if (var9.isNotation()) {
  279.             if (var6) {
  280.                super.errors.addElement(new ParserException(211, ((BaseDeclaration)var9).getName()));
  281.             } else {
  282.                var6 = true;
  283.             }
  284.          }
  285.       }
  286.  
  287.       BaseDeclaration var13 = var1.getNamedDeclaration(((BaseDeclaration)this).getName(), this.getClass());
  288.       if (var13 != this) {
  289.          super.errors.addElement(new ParserException(213, ((BaseDeclaration)this).getName()));
  290.       }
  291.  
  292.       if (this.getCMisMixed()) {
  293.          Hashtable var10 = new Hashtable();
  294.          this.visitTerms(new 3(var10, this), true);
  295.          this.visitTerms(new 4(this), true);
  296.          ContentModelTerm var11 = this.field_0.getRootGroup();
  297.          if (var11 != null && var11.getOccurance() != '*') {
  298.             if (var11.isGroup() && var11.getOwner() == this) {
  299.                var11.setOccurance('*');
  300.             } else {
  301.                super.errors.addElement(new ParserException(228, ""));
  302.             }
  303.          }
  304.       }
  305.  
  306.       if (this.getAllowsTags()) {
  307.          this.visitTerms(new 5(this), true);
  308.       }
  309.  
  310.       if (this.getSuperType() != null && this.getSuperType().getTargetObj() == null) {
  311.          super.errors.addElement(new ParserException(269, this.getSuperTypeName()));
  312.       }
  313.  
  314.    }
  315.  
  316.    public boolean isSubTypeOf(ElementDeclaration var1) {
  317.       if (this.superType == null) {
  318.          return false;
  319.       } else {
  320.          ElementDeclaration var2 = this.superType.getTargetElement();
  321.          if (var2 == null) {
  322.             return false;
  323.          } else {
  324.             return var2 == var1 ? true : var2.isSubTypeOf(var1);
  325.          }
  326.       }
  327.    }
  328.  
  329.    protected void releaseBindings() {
  330.       if (this.superType != null) {
  331.          this.superType.release();
  332.       }
  333.  
  334.       this.visitTerms(new 7(this), false);
  335.    }
  336.  
  337.    protected void establishBindings() {
  338.       if (this.superType != null) {
  339.          this.superType.bind(((BaseDeclaration)this).getSchema(), this);
  340.       }
  341.  
  342.       this.visitTerms(new 8(this), false);
  343.    }
  344.  
  345.    public void setSuperType(String var1) {
  346.       this.setSuperType(var1 == null ? null : new DeclRef(var1, Class.forName("com.extensibility.xml.ElementDeclaration")));
  347.    }
  348.  
  349.    public void setSuperType(DeclRef var1) {
  350.       DeclRef var2 = this.superType;
  351.       if (this.superType != null) {
  352.          if (this.superType.isBound()) {
  353.             this.superType.release();
  354.          }
  355.  
  356.          this.superType.removeChangeListener(this.changer);
  357.       }
  358.  
  359.       this.superType = var1;
  360.       if (var1 != null) {
  361.          if (((BaseDeclaration)this).getSchema() != null) {
  362.             var1.bind(((BaseDeclaration)this).getSchema(), this);
  363.          }
  364.  
  365.          var1.addChangeListener(this.changer);
  366.       }
  367.  
  368.       ((BaseDeclaration)this).fireChangeEvent(35, var2);
  369.    }
  370.  
  371.    public DeclRef getSuperType() {
  372.       return this.superType;
  373.    }
  374.  
  375.    public String getSuperTypeName() {
  376.       return this.superType == null ? null : this.superType.getName();
  377.    }
  378.  
  379.    public ContentModel getEffectiveModel() {
  380.       ContentModel var1 = this.getContentModel();
  381.       if (this.getSuperType() != null && this.getSuperType().getTargetObj() != null) {
  382.          ContentModel var2 = this.getSuperType().getTargetElement().getEffectiveModel();
  383.          var1 = (ContentModel)var2.clone(var1, true);
  384.       }
  385.  
  386.       return var1;
  387.    }
  388.  
  389.    public boolean cmContains(String var1) {
  390.       return this.field_0.contains(var1);
  391.    }
  392.  
  393.    public void add(AttributeGroupMember var1) {
  394.       if (this.attributes.add(var1)) {
  395.          ((BaseDeclaration)this).fireChangeEvent(33, var1);
  396.       }
  397.  
  398.    }
  399.  
  400.    public void remove(AttributeGroupMember var1) {
  401.       this.attributes.remove(var1);
  402.       ((BaseDeclaration)this).fireChangeEvent(32, var1);
  403.    }
  404.  
  405.    public Enumeration getOwnedAttributes() {
  406.       return new FilteredEnumerator(this.getAttributes(false), Class.forName("com.extensibility.xml.AttributeDeclaration"));
  407.    }
  408.  
  409.    public Enumeration getAttributes(boolean var1) {
  410.       return this.attributes.getAttributes(var1);
  411.    }
  412.  
  413.    public Vector getAttributesCopy() {
  414.       Vector var1 = new Vector();
  415.  
  416.       for(int var2 = 0; var2 < this.attributes.attributes.size(); ++var2) {
  417.          var1.addElement(this.attributes.attributes.elementAt(var2));
  418.       }
  419.  
  420.       return var1;
  421.    }
  422.  
  423.    public Vector updateAttributes(Vector var1) {
  424.       Vector var2 = this.attributes.updateContents(var1);
  425.       ((BaseDeclaration)this).fireChangeEvent(34, (Object)null);
  426.       return var2;
  427.    }
  428.  
  429.    public String getSource() {
  430.       StringBuffer var1 = new StringBuffer(String.valueOf(String.valueOf("<!ELEMENT ").concat(String.valueOf(super.name))).concat(String.valueOf(" ")));
  431.       String var2 = this.field_0.getSource(true);
  432.       var1.append(var2);
  433.       var1.append(String.valueOf(">").concat(String.valueOf(BaseDeclaration.LINE_SEPARATOR)));
  434.       return var1.toString();
  435.    }
  436.  
  437.    public void setEmpty() {
  438.       this.dataType = null;
  439.       this.getContentModel().setEmpty();
  440.    }
  441.  
  442.    public void setTextOnly() {
  443.       this.dataType = null;
  444.       this.getContentModel().setTextOnly();
  445.    }
  446.  
  447.    public void setAny() {
  448.       this.dataType = null;
  449.       this.getContentModel().setAny();
  450.    }
  451.  
  452.    public void setMixed() {
  453.       this.dataType = null;
  454.       this.getContentModel().setMixed();
  455.    }
  456.  
  457.    public void setAllowsText(boolean var1) {
  458.       if (var1 && this.dataType != null) {
  459.          this.dataType = null;
  460.       }
  461.  
  462.       this.setContentModel(var1, this.getAllowsTags());
  463.    }
  464.  
  465.    public void setContentModel(int var1) {
  466.       this.field_0.setContentModel(var1);
  467.    }
  468.  
  469.    public void setAllowsTags(boolean var1) {
  470.       if (var1 && this.dataType != null) {
  471.          this.dataType = null;
  472.       }
  473.  
  474.       this.setContentModel(this.getAllowsText(), var1);
  475.    }
  476.  
  477.    public void setAllowsData(boolean var1) {
  478.       if (var1) {
  479.          this.dataType = DataTypeFactory.createDataType(DataTypeIntf.STRING);
  480.       } else {
  481.          this.dataType = null;
  482.       }
  483.  
  484.       this.setContentModel(true, false);
  485.    }
  486.  
  487.    public void setDataType(DataType var1) {
  488.       this.dataType = var1;
  489.       this.setContentModel(true, false);
  490.    }
  491.  
  492.    public BaseDeclaration asDecl() {
  493.       return this;
  494.    }
  495.  
  496.    public void addCMTerm(ElementDeclaration var1, char var2) {
  497.       if (this.field_0.isEmpty()) {
  498.          this.field_0.setContentModel(6);
  499.       } else if (this.field_0.isAny()) {
  500.          this.field_0.setContentModel(4);
  501.       }
  502.  
  503.       ContentModelTerm var3 = this.field_0.getRootGroup();
  504.       Debug.assert(var3 != null, "no term to add it to...");
  505.       Debug.assert(var3.getOwner() == this, String.valueOf("wrong owner: ").concat(String.valueOf(var3.getOwner())));
  506.       var3.addTerm(new ContentModelTerm(new TypeRef(((BaseDeclaration)var1).getName()), var2, ','));
  507.    }
  508.  
  509.    public void setDataType(String var1) {
  510.       this.dataType = DataTypeFactory.createDataType(var1);
  511.       this.setContentModel(true, false);
  512.    }
  513.  
  514.    public void setContentModel(boolean var1, boolean var2) {
  515.       this.field_0.setContentModel(var1, var2);
  516.       ((BaseDeclaration)this).fireChangeEvent(31, (Object)null);
  517.    }
  518.  
  519.    public AttributeDeclaration getAttribute(String var1) {
  520.       return this.attributes.getAttribute(var1);
  521.    }
  522.  
  523.    public AttributeGroupMember getAttributeOrGroup(String var1) {
  524.       return this.attributes.getAttributeOrGroup(var1);
  525.    }
  526.  
  527.    public AttributeDeclaration getNotationAttr() {
  528.       Enumeration var1 = this.attributes.getAttributes(true);
  529.  
  530.       while(var1.hasMoreElements()) {
  531.          AttributeDeclaration var2 = (AttributeDeclaration)var1.nextElement();
  532.          if (var2.isNotation()) {
  533.             return var2;
  534.          }
  535.       }
  536.  
  537.       return null;
  538.    }
  539.  
  540.    public AttributeGroup getAttributeGroup() {
  541.       return this.attributes;
  542.    }
  543.  
  544.    public String getAttributesAsString(boolean var1) {
  545.       return this.attributes.getAttributesAsString(var1);
  546.    }
  547.  
  548.    public void write(Writer var1) throws IOException {
  549.       super.fireOnMetaPropChange = false;
  550.  
  551.       try {
  552.          var1.write(((BaseDeclaration)this).getCommentsAsSource());
  553.          var1.write(this.getSource());
  554.          Vector var2 = this.addMetaAttrs();
  555.          BaseDeclaration var3 = super.schema.getDeclarationAfter(this);
  556.          if (var3 != null && var3 instanceof EntityDeclaration) {
  557.             Object var4 = null;
  558.             Vector var9 = this.attributes.getUsesList((Vector)null);
  559.             if (var9 != null && var9.contains(var3)) {
  560.                var3.write(var1);
  561.             }
  562.          }
  563.  
  564.          var1.write(this.attributes.getSource(!this.attributes.hasComments()));
  565.          this.removeMetaAttrs(var2);
  566.          var1.write(System.getProperty("line.separator"));
  567.       } finally {
  568.          super.fireOnMetaPropChange = true;
  569.       }
  570.  
  571.    }
  572.  
  573.    private Vector addMetaAttrs() {
  574.       Vector var1 = new Vector();
  575.       if (this.dataType != null && !this.dataType.equals(DataTypeFactory.createDataType(DataTypeIntf.NOTATED))) {
  576.          ((BaseDeclaration)this).putMetaProp("dtype", this.dataType.getSource());
  577.       } else {
  578.          ((BaseDeclaration)this).removeMetaProp("dtype");
  579.       }
  580.  
  581.       Enumeration var2 = ((BaseDeclaration)this).getMetaProps();
  582.  
  583.       while(var2 != null && var2.hasMoreElements()) {
  584.          String var3 = (String)var2.nextElement();
  585.          if (var3.indexOf(58) < 0) {
  586.             Object var4 = ((BaseDeclaration)this).getMetaProp(var3);
  587.             String var5;
  588.             DataType var6;
  589.             if (var4 instanceof String[]) {
  590.                var6 = DataTypeFactory.createDataType(8);
  591.                var5 = "";
  592.                String[] var7 = (String[])var4;
  593.  
  594.                for(int var8 = 0; var8 < var7.length; ++var8) {
  595.                   if (var5.equals("")) {
  596.                      var5 = var7[var8];
  597.                   } else {
  598.                      var5 = String.valueOf(String.valueOf(var5).concat(String.valueOf(" "))).concat(String.valueOf(var7[var8]));
  599.                   }
  600.                }
  601.             } else {
  602.                if (!(var4 instanceof String)) {
  603.                   continue;
  604.                }
  605.  
  606.                var6 = DataTypeFactory.createDataType(7);
  607.                var5 = (String)var4;
  608.             }
  609.  
  610.             AttributeDeclaration var15 = new AttributeDeclaration(this, String.valueOf("e-").concat(String.valueOf(var3)), var6, true, var5);
  611.             var1.addElement(var15);
  612.             this.attributes.add(var15);
  613.          }
  614.       }
  615.  
  616.       Enumeration var9 = this.attributes.getAttributes(true);
  617.  
  618.       while(var9.hasMoreElements()) {
  619.          AttributeDeclaration var10 = (AttributeDeclaration)var9.nextElement();
  620.          if (!var10.isPrimitive()) {
  621.             boolean var12 = ((BaseDeclaration)var10).getFireOnMetaPropChange();
  622.             ((BaseDeclaration)var10).setFireOnMetaPropChange(super.fireOnMetaPropChange);
  623.             ((BaseDeclaration)var10).putMetaProp("dtype", var10.getDataType().getSource());
  624.             ((BaseDeclaration)var10).setFireOnMetaPropChange(var12);
  625.          }
  626.       }
  627.  
  628.       Enumeration var11 = this.attributes.getMetaProps();
  629.  
  630.       while(var11 != null && var11.hasMoreElements()) {
  631.          String var13 = (String)var11.nextElement();
  632.          String var14 = this.attributes.getMetaProps(var13);
  633.          AttributeDeclaration var16 = new AttributeDeclaration(this, String.valueOf("a-").concat(String.valueOf(var13)), DataTypeFactory.createDataType(8), true, var14);
  634.          var1.addElement(var16);
  635.          this.attributes.add(var16);
  636.       }
  637.  
  638.       return var1;
  639.    }
  640.  
  641.    private void removeMetaAttrs(Vector var1) {
  642.       for(int var2 = var1.size() - 1; var2 >= 0; --var2) {
  643.          this.attributes.remove((AttributeDeclaration)var1.elementAt(var2));
  644.       }
  645.  
  646.       ((BaseDeclaration)this).removeMetaProp("dtype");
  647.       Enumeration var3 = this.attributes.getAttributes(true);
  648.  
  649.       while(var3.hasMoreElements()) {
  650.          AttributeDeclaration var4 = (AttributeDeclaration)var3.nextElement();
  651.          if (!var4.isPrimitive()) {
  652.             boolean var5 = ((BaseDeclaration)var4).getFireOnMetaPropChange();
  653.             ((BaseDeclaration)var4).setFireOnMetaPropChange(super.fireOnMetaPropChange);
  654.             ((BaseDeclaration)var4).removeMetaProp("dtype");
  655.             ((BaseDeclaration)var4).setFireOnMetaPropChange(var5);
  656.          }
  657.       }
  658.  
  659.    }
  660.  
  661.    public void addDependantsToSet(XASet var1) {
  662.       Enumeration var2 = this.getOwnedAttributes();
  663.  
  664.       while(var2.hasMoreElements()) {
  665.          var1.addToSet(var2.nextElement());
  666.       }
  667.  
  668.    }
  669.  
  670.    public String getSampleData() {
  671.       if (super.sampleData == null) {
  672.          ContentModel var1 = this.getEffectiveModel();
  673.          if (var1.isAny()) {
  674.             return BaseDeclaration.resourceBundle.getString("xml.exemplar.any");
  675.          }
  676.  
  677.          if (var1.isEmpty()) {
  678.             return null;
  679.          }
  680.  
  681.          if (this.getDataType() != null) {
  682.             String var2;
  683.             try {
  684.                var2 = BaseDeclaration.resourceBundle.getString(String.valueOf("xml.exemplar.dt.").concat(String.valueOf(this.getDataType().getSource())));
  685.             } catch (MissingResourceException var4) {
  686.                var2 = BaseDeclaration.resourceBundle.getString("xml.exemplar.text.only");
  687.             }
  688.  
  689.             return var2;
  690.          }
  691.  
  692.          if (var1.isTextOnly()) {
  693.             return BaseDeclaration.resourceBundle.getString("xml.exemplar.text.only");
  694.          }
  695.  
  696.          if (var1.isTagsOnly()) {
  697.             return null;
  698.          }
  699.  
  700.          if (var1.isMixed()) {
  701.             return BaseDeclaration.resourceBundle.getString("xml.exemplar.text.mixed");
  702.          }
  703.       }
  704.  
  705.       return super.sampleData;
  706.    }
  707.  
  708.    private void updateRefMetaProp(String var1, String var2) {
  709.       Enumeration var3 = this.refMetaProp.keys();
  710.  
  711.       while(var3.hasMoreElements()) {
  712.          String var4 = (String)var3.nextElement();
  713.          if (var4.equals(var1)) {
  714.             Hashtable var5 = (Hashtable)this.refMetaProp.get(var4);
  715.             this.refMetaProp.remove(var4);
  716.             this.refMetaProp.put(var2, var5);
  717.             return;
  718.          }
  719.       }
  720.  
  721.    }
  722.  
  723.    public void putCPMetaProp(String var1, String var2, String var3) {
  724.       MetaPropHash var4 = (MetaPropHash)this.refMetaProp.get(var1);
  725.       if (var4 == null) {
  726.          var4 = new MetaPropHash();
  727.          this.refMetaProp.put(var1, var4);
  728.       }
  729.  
  730.       var4.putMetaProp(var2, var3);
  731.    }
  732.  
  733.    public Object getCPMetaProp(String var1, String var2) {
  734.       MetaPropHash var3 = (MetaPropHash)this.refMetaProp.get(var1);
  735.       return var3 == null ? null : var3.getMetaProp(var2);
  736.    }
  737.  
  738.    public Enumeration getCPMetaProps(String var1) {
  739.       MetaPropHash var2 = (MetaPropHash)this.refMetaProp.get(var1);
  740.       return var2 == null ? null : var2.getMetaProps();
  741.    }
  742.  
  743.    public RHashtable getCPMetaProps() {
  744.       return this.refMetaProp;
  745.    }
  746.  
  747.    public void setCPMetaProps(RHashtable var1) {
  748.       this.refMetaProp = var1;
  749.    }
  750.  
  751.    public void removeCPMetaProp(String var1, String var2) {
  752.       MetaPropHash var3 = (MetaPropHash)this.refMetaProp.get(var1);
  753.       if (var3 != null) {
  754.          var3.removeMetaProp(var2);
  755.       }
  756.  
  757.    }
  758. }
  759.